<?php
define("EW_PAGE_ID", "search", TRUE); // Page ID
define("EW_TABLE_NAME", 'view_reg_master_netsales', TRUE);
?>
<?php 
session_start(); // Initialize session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg50.php" ?>
<?php include "ewmysql50.php" ?>
<?php include "phpfn50.php" ?>
<?php include "view_reg_master_netsalesinfo.php" ?>
<?php include "userfn50.php" ?>
<?php include "tb_usersinfo.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1 
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php

// Open connection to the database
$conn = ew_Connect();
?>
<?php
$Security = new cAdvancedSecurity();
?>
<?php
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if (!$Security->IsLoggedIn()) {
	$Security->SaveLastUrl();
	Page_Terminate("login.php");
}
?>
<?php

// Common page loading event (in userfn*.php)
Page_Loading();
?>
<?php

// Page load event, used in current page
Page_Load();
?>
<?php
$view_reg_master_netsales->Export = @$_GET["export"]; // Get export parameter
$sExport = $view_reg_master_netsales->Export; // Get export parameter, used in header
$sExportFile = $view_reg_master_netsales->TableVar; // Get export file, used in header
?>
<?php

// Get action
$view_reg_master_netsales->CurrentAction = @$_POST["a_search"];
switch ($view_reg_master_netsales->CurrentAction) {
	case "S": // Get Search Criteria

		// Build search string for advanced search, remove blank field
		$sSrchStr = BuildAdvancedSearch();
		if ($sSrchStr <> "") {
			Page_Terminate("view_reg_master_netsaleslist.php?" . $sSrchStr); // Go to list page
		}
		break;
	default: // Restore search settings
		LoadAdvancedSearch();
}

// Render row for search
$view_reg_master_netsales->RowType = EW_ROWTYPE_SEARCH;
RenderRow();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
var EW_PAGE_ID = "search"; // Page id

//-->
</script>
<script type="text/javascript">
<!--

function ew_ValidateForm(fobj) {
	if (fobj.a_confirm && fobj.a_confirm.value == "F")
		return true;
	var i, elm, aelm, infix;
	var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
	for (i=0; i<rowcnt; i++) {
		infix = (fobj.key_count) ? String(i+1) : "";
		elm = fobj.elements["x" + infix + "_ID"];
		if (elm && !ew_CheckInteger(elm.value)) {
			if (!ew_OnError(elm, "Incorrect integer - ID"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_LogDate"];
		if (elm && !ew_CheckDate(elm.value)) {
			if (!ew_OnError(elm, "Incorrect date, format = yyyy/mm/dd - Log Date"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_StoreNet"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Store Net"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_ShortOver"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Short Over"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_DiffIPP"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Diff IPP"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_LogIPP"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Log IPP"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_BankIPP"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Bank IPP"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_DiffXreading"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Diff XRead"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_MOAmt"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - MO Amt"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_BankMO"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Bank MO"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_BankCC"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Bank CC"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_DiffCopay"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Diff Copay"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_CheckAmt"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Check Amt"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_CreditAmt"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Credit Amt"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_LunchAmt"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Lunch Amt"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_PayoutAmt"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Payout Amt"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_z340B"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - 340B"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_R228CI29"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - R2(CI)"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_Kinray"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Kinray"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_CashAdj"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Cash Adj"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_OverAmt"];
		if (elm && !ew_CheckNumber(elm.value)) {
			if (!ew_OnError(elm, "Incorrect floating point number - Over Amt"))
				return false; 
		}
	}
	return true;
}

//-->
</script>
<script type="text/javascript">
<!--
var ew_DHTMLEditors = [];

//-->
</script>
<link rel="stylesheet" type="text/css" media="all" href="calendar/calendar-win2k-1.css" title="win2k-1" />
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></script>
<script language="JavaScript" type="text/javascript">
<!--

// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js"); 
//-->

</script>
<p><span class="phpmaker">Search View: Register Master (NetSales)<br><br><a href="view_reg_master_netsaleslist.php">Back to List</a></span></p>
<form name="fview_reg_master_netsalessearch" id="fview_reg_master_netsalessearch" action="view_reg_master_netsalessrch.php" method="post" onSubmit="return ew_ValidateForm(this);">
<p>
<input type="hidden" name="a_search" id="a_search" value="S">
<table class="ewTable">
	<tr class="ewTableRow">
		<td class="ewTableHeader">ID</td>
		<td<?php echo $view_reg_master_netsales->ID->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_ID" id="z_ID" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->ID->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_ID" id="x_ID" title="" value="<?php echo $view_reg_master_netsales->ID->EditValue ?>"<?php echo $view_reg_master_netsales->ID->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Log Date</td>
		<td<?php echo $view_reg_master_netsales->LogDate->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_LogDate" id="z_LogDate" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->LogDate->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_LogDate" id="x_LogDate" title="" value="<?php echo $view_reg_master_netsales->LogDate->EditValue ?>"<?php echo $view_reg_master_netsales->LogDate->EditAttributes() ?>>
&nbsp;<img src="images/ew_calendar.gif" id="cx_LogDate" alt="Pick a Date" style="cursor:pointer;cursor:hand;">
<script type="text/javascript">
Calendar.setup(
{
inputField : "x_LogDate", // ID of the input field
ifFormat : "%Y/%m/%d", // the date format
button : "cx_LogDate" // ID of the button
}
);
</script>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Reg ID</td>
		<td<?php echo $view_reg_master_netsales->RegID->CellAttributes() ?>><span class="ewSearchOpr">contains<input type="hidden" name="z_RegID" id="z_RegID" value="LIKE"></span></td>
		<td<?php echo $view_reg_master_netsales->RegID->CellAttributes() ?>><span class="phpmaker">
<select id="x_RegID" name="x_RegID"<?php echo $view_reg_master_netsales->RegID->EditAttributes() ?>>
<!--option value="">Please Select</option-->
<?php
if (is_array($view_reg_master_netsales->RegID->EditValue)) {
	$arwrk = $view_reg_master_netsales->RegID->EditValue;
	$rowswrk = count($arwrk);
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($view_reg_master_netsales->RegID->AdvancedSearch->SearchValue) == strval($arwrk[$rowcntwrk][0])) ? " selected" : "";	
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
			}
}
?>
</select>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">User Name</td>
		<td<?php echo $view_reg_master_netsales->UserName->CellAttributes() ?>><span class="ewSearchOpr">contains<input type="hidden" name="z_UserName" id="z_UserName" value="LIKE"></span></td>
		<td<?php echo $view_reg_master_netsales->UserName->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_UserName" id="x_UserName" title="" size="30" maxlength="45" value="<?php echo $view_reg_master_netsales->UserName->EditValue ?>"<?php echo $view_reg_master_netsales->UserName->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Store Net</td>
		<td<?php echo $view_reg_master_netsales->StoreNet->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_StoreNet" id="z_StoreNet" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->StoreNet->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_StoreNet" id="x_StoreNet" title="" size="30" value="<?php echo $view_reg_master_netsales->StoreNet->EditValue ?>"<?php echo $view_reg_master_netsales->StoreNet->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Short Over</td>
		<td<?php echo $view_reg_master_netsales->ShortOver->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_ShortOver" id="z_ShortOver" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->ShortOver->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_ShortOver" id="x_ShortOver" title="" size="30" value="<?php echo $view_reg_master_netsales->ShortOver->EditValue ?>"<?php echo $view_reg_master_netsales->ShortOver->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Diff IPP</td>
		<td<?php echo $view_reg_master_netsales->DiffIPP->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_DiffIPP" id="z_DiffIPP" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->DiffIPP->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_DiffIPP" id="x_DiffIPP" title="" size="30" value="<?php echo $view_reg_master_netsales->DiffIPP->EditValue ?>"<?php echo $view_reg_master_netsales->DiffIPP->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Log IPP</td>
		<td<?php echo $view_reg_master_netsales->LogIPP->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_LogIPP" id="z_LogIPP" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->LogIPP->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_LogIPP" id="x_LogIPP" title="" size="30" value="<?php echo $view_reg_master_netsales->LogIPP->EditValue ?>"<?php echo $view_reg_master_netsales->LogIPP->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Bank IPP</td>
		<td<?php echo $view_reg_master_netsales->BankIPP->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_BankIPP" id="z_BankIPP" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->BankIPP->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_BankIPP" id="x_BankIPP" title="" size="30" value="<?php echo $view_reg_master_netsales->BankIPP->EditValue ?>"<?php echo $view_reg_master_netsales->BankIPP->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Diff XRead</td>
		<td<?php echo $view_reg_master_netsales->DiffXreading->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_DiffXreading" id="z_DiffXreading" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->DiffXreading->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_DiffXreading" id="x_DiffXreading" title="" size="30" value="<?php echo $view_reg_master_netsales->DiffXreading->EditValue ?>"<?php echo $view_reg_master_netsales->DiffXreading->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">MO Amt</td>
		<td<?php echo $view_reg_master_netsales->MOAmt->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_MOAmt" id="z_MOAmt" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->MOAmt->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_MOAmt" id="x_MOAmt" title="" size="30" value="<?php echo $view_reg_master_netsales->MOAmt->EditValue ?>"<?php echo $view_reg_master_netsales->MOAmt->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Bank MO</td>
		<td<?php echo $view_reg_master_netsales->BankMO->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_BankMO" id="z_BankMO" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->BankMO->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_BankMO" id="x_BankMO" title="" size="30" value="<?php echo $view_reg_master_netsales->BankMO->EditValue ?>"<?php echo $view_reg_master_netsales->BankMO->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Bank CC</td>
		<td<?php echo $view_reg_master_netsales->BankCC->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_BankCC" id="z_BankCC" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->BankCC->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_BankCC" id="x_BankCC" title="" size="30" value="<?php echo $view_reg_master_netsales->BankCC->EditValue ?>"<?php echo $view_reg_master_netsales->BankCC->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Diff Copay</td>
		<td<?php echo $view_reg_master_netsales->DiffCopay->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_DiffCopay" id="z_DiffCopay" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->DiffCopay->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_DiffCopay" id="x_DiffCopay" title="" size="30" value="<?php echo $view_reg_master_netsales->DiffCopay->EditValue ?>"<?php echo $view_reg_master_netsales->DiffCopay->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Check Amt</td>
		<td<?php echo $view_reg_master_netsales->CheckAmt->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_CheckAmt" id="z_CheckAmt" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->CheckAmt->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_CheckAmt" id="x_CheckAmt" title="" size="30" value="<?php echo $view_reg_master_netsales->CheckAmt->EditValue ?>"<?php echo $view_reg_master_netsales->CheckAmt->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Credit Amt</td>
		<td<?php echo $view_reg_master_netsales->CreditAmt->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_CreditAmt" id="z_CreditAmt" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->CreditAmt->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_CreditAmt" id="x_CreditAmt" title="" size="30" value="<?php echo $view_reg_master_netsales->CreditAmt->EditValue ?>"<?php echo $view_reg_master_netsales->CreditAmt->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Lunch Amt</td>
		<td<?php echo $view_reg_master_netsales->LunchAmt->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_LunchAmt" id="z_LunchAmt" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->LunchAmt->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_LunchAmt" id="x_LunchAmt" title="" size="30" value="<?php echo $view_reg_master_netsales->LunchAmt->EditValue ?>"<?php echo $view_reg_master_netsales->LunchAmt->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Payout Amt</td>
		<td<?php echo $view_reg_master_netsales->PayoutAmt->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_PayoutAmt" id="z_PayoutAmt" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->PayoutAmt->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_PayoutAmt" id="x_PayoutAmt" title="" size="30" value="<?php echo $view_reg_master_netsales->PayoutAmt->EditValue ?>"<?php echo $view_reg_master_netsales->PayoutAmt->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">340B</td>
		<td<?php echo $view_reg_master_netsales->z340B->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_z340B" id="z_z340B" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->z340B->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_z340B" id="x_z340B" title="" size="30" value="<?php echo $view_reg_master_netsales->z340B->EditValue ?>"<?php echo $view_reg_master_netsales->z340B->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">R2(CI)</td>
		<td<?php echo $view_reg_master_netsales->R228CI29->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_R228CI29" id="z_R228CI29" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->R228CI29->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_R228CI29" id="x_R228CI29" title="" size="30" value="<?php echo $view_reg_master_netsales->R228CI29->EditValue ?>"<?php echo $view_reg_master_netsales->R228CI29->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Kinray</td>
		<td<?php echo $view_reg_master_netsales->Kinray->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_Kinray" id="z_Kinray" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->Kinray->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_Kinray" id="x_Kinray" title="" size="30" value="<?php echo $view_reg_master_netsales->Kinray->EditValue ?>"<?php echo $view_reg_master_netsales->Kinray->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Cash Adj</td>
		<td<?php echo $view_reg_master_netsales->CashAdj->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_CashAdj" id="z_CashAdj" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->CashAdj->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_CashAdj" id="x_CashAdj" title="" size="30" value="<?php echo $view_reg_master_netsales->CashAdj->EditValue ?>"<?php echo $view_reg_master_netsales->CashAdj->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Over Amt</td>
		<td<?php echo $view_reg_master_netsales->OverAmt->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_OverAmt" id="z_OverAmt" value="="></span></td>
		<td<?php echo $view_reg_master_netsales->OverAmt->CellAttributes() ?>><span class="phpmaker">
<input type="text" name="x_OverAmt" id="x_OverAmt" title="" size="30" value="<?php echo $view_reg_master_netsales->OverAmt->EditValue ?>"<?php echo $view_reg_master_netsales->OverAmt->EditAttributes() ?>>
</span></td>
	</tr>
</table>
<p>
<input type="submit" name="Action" id="Action" value="  Search  ">
<input type="button" name="Reset" id="Reset" value="   Reset   " onclick="ew_ClearForm(this.form);">
</form>
<script language="JavaScript" type="text/javascript">
<!--

// Write your table-specific startup script here
// document.write("page loaded");
//-->

</script>
<?php include "footer.php" ?>
<?php

// If control is passed here, simply terminate the page without redirect
Page_Terminate();

// -----------------------------------------------------------------
//  Subroutine Page_Terminate
//  - called when exit page
//  - clean up connection and objects
//  - if url specified, redirect to url, otherwise end response
function Page_Terminate($url = "") {
	global $conn;

	// Page unload event, used in current page
	Page_Unload();

	// Global page unloaded event (in userfn*.php)
	Page_Unloaded();

	 // Close Connection
	$conn->Close();

	// Go to url if specified
	if ($url <> "") {
		ob_end_clean();
		header("Location: $url");
	}
	exit();
}
?>
<?php

// Build advanced search
function BuildAdvancedSearch() {
	global $view_reg_master_netsales;
	$sSrchUrl = "";

	// Field ID
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->ID, @$_POST["x_ID"], @$_POST["z_ID"], @$_POST["v_ID"], @$_POST["y_ID"], @$_POST["w_ID"]);

	// Field LogDate
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->LogDate, ew_UnFormatDateTime(@$_POST["x_LogDate"],5), @$_POST["z_LogDate"], @$_POST["v_LogDate"], ew_UnFormatDateTime(@$_POST["y_LogDate"],5), @$_POST["w_LogDate"]);

	// Field RegID
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->RegID, @$_POST["x_RegID"], @$_POST["z_RegID"], @$_POST["v_RegID"], @$_POST["y_RegID"], @$_POST["w_RegID"]);

	// Field UserName
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->UserName, @$_POST["x_UserName"], @$_POST["z_UserName"], @$_POST["v_UserName"], @$_POST["y_UserName"], @$_POST["w_UserName"]);

	// Field StoreNet
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->StoreNet, @$_POST["x_StoreNet"], @$_POST["z_StoreNet"], @$_POST["v_StoreNet"], @$_POST["y_StoreNet"], @$_POST["w_StoreNet"]);

	// Field ShortOver
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->ShortOver, @$_POST["x_ShortOver"], @$_POST["z_ShortOver"], @$_POST["v_ShortOver"], @$_POST["y_ShortOver"], @$_POST["w_ShortOver"]);

	// Field DiffIPP
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->DiffIPP, @$_POST["x_DiffIPP"], @$_POST["z_DiffIPP"], @$_POST["v_DiffIPP"], @$_POST["y_DiffIPP"], @$_POST["w_DiffIPP"]);

	// Field LogIPP
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->LogIPP, @$_POST["x_LogIPP"], @$_POST["z_LogIPP"], @$_POST["v_LogIPP"], @$_POST["y_LogIPP"], @$_POST["w_LogIPP"]);

	// Field BankIPP
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->BankIPP, @$_POST["x_BankIPP"], @$_POST["z_BankIPP"], @$_POST["v_BankIPP"], @$_POST["y_BankIPP"], @$_POST["w_BankIPP"]);

	// Field DiffXreading
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->DiffXreading, @$_POST["x_DiffXreading"], @$_POST["z_DiffXreading"], @$_POST["v_DiffXreading"], @$_POST["y_DiffXreading"], @$_POST["w_DiffXreading"]);

	// Field MOAmt
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->MOAmt, @$_POST["x_MOAmt"], @$_POST["z_MOAmt"], @$_POST["v_MOAmt"], @$_POST["y_MOAmt"], @$_POST["w_MOAmt"]);

	// Field BankMO
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->BankMO, @$_POST["x_BankMO"], @$_POST["z_BankMO"], @$_POST["v_BankMO"], @$_POST["y_BankMO"], @$_POST["w_BankMO"]);

	// Field BankCC
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->BankCC, @$_POST["x_BankCC"], @$_POST["z_BankCC"], @$_POST["v_BankCC"], @$_POST["y_BankCC"], @$_POST["w_BankCC"]);

	// Field DiffCopay
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->DiffCopay, @$_POST["x_DiffCopay"], @$_POST["z_DiffCopay"], @$_POST["v_DiffCopay"], @$_POST["y_DiffCopay"], @$_POST["w_DiffCopay"]);

	// Field CheckAmt
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->CheckAmt, @$_POST["x_CheckAmt"], @$_POST["z_CheckAmt"], @$_POST["v_CheckAmt"], @$_POST["y_CheckAmt"], @$_POST["w_CheckAmt"]);

	// Field CreditAmt
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->CreditAmt, @$_POST["x_CreditAmt"], @$_POST["z_CreditAmt"], @$_POST["v_CreditAmt"], @$_POST["y_CreditAmt"], @$_POST["w_CreditAmt"]);

	// Field LunchAmt
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->LunchAmt, @$_POST["x_LunchAmt"], @$_POST["z_LunchAmt"], @$_POST["v_LunchAmt"], @$_POST["y_LunchAmt"], @$_POST["w_LunchAmt"]);

	// Field PayoutAmt
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->PayoutAmt, @$_POST["x_PayoutAmt"], @$_POST["z_PayoutAmt"], @$_POST["v_PayoutAmt"], @$_POST["y_PayoutAmt"], @$_POST["w_PayoutAmt"]);

	// Field 340B
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->z340B, @$_POST["x_z340B"], @$_POST["z_z340B"], @$_POST["v_z340B"], @$_POST["y_z340B"], @$_POST["w_z340B"]);

	// Field R2(CI)
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->R228CI29, @$_POST["x_R228CI29"], @$_POST["z_R228CI29"], @$_POST["v_R228CI29"], @$_POST["y_R228CI29"], @$_POST["w_R228CI29"]);

	// Field Kinray
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->Kinray, @$_POST["x_Kinray"], @$_POST["z_Kinray"], @$_POST["v_Kinray"], @$_POST["y_Kinray"], @$_POST["w_Kinray"]);

	// Field CashAdj
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->CashAdj, @$_POST["x_CashAdj"], @$_POST["z_CashAdj"], @$_POST["v_CashAdj"], @$_POST["y_CashAdj"], @$_POST["w_CashAdj"]);

	// Field OverAmt
	BuildSearchUrl($sSrchUrl, $view_reg_master_netsales->OverAmt, @$_POST["x_OverAmt"], @$_POST["z_OverAmt"], @$_POST["v_OverAmt"], @$_POST["y_OverAmt"], @$_POST["w_OverAmt"]);
	return $sSrchUrl;
}

// Function to build search URL
function BuildSearchUrl(&$Url, &$Fld, $FldVal, $FldOpr, $FldCond, $FldVal2, $FldOpr2) {
	$sWrk = "";
	$FldParm = substr($Fld->FldVar, 2);
	$FldVal = ew_StripSlashes($FldVal);
	if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
	$FldVal2 = ew_StripSlashes($FldVal2);
	if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
	$FldOpr = strtoupper(trim($FldOpr));
	if ($FldOpr == "BETWEEN") {
		$IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
			($Fld->FldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal) && is_numeric($FldVal2));
		if ($FldVal <> "" && $FldVal2 <> "" && $IsValidValue) {
			$sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
				"&y_" . $FldParm . "=" . urlencode($FldVal2) .
				"&z_" . $FldParm . "=" . urlencode($FldOpr);
		}
	} elseif ($FldOpr == "IS NULL" || $FldOpr == "IS NOT NULL") {
		$sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
			"&z_" . $FldParm . "=" . urlencode($FldOpr);
	} else {
		$IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
			($Fld->FldDataType = EW_DATATYPE_NUMBER && is_numeric($FldVal));
		if ($FldVal <> "" && $IsValidValue && ew_IsValidOpr($FldOpr, $Fld->FldDataType)) {
			$sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
				"&z_" . $FldParm . "=" . urlencode($FldOpr);
		}
		$IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
			($Fld->FldDataType = EW_DATATYPE_NUMBER && is_numeric($FldVal2));
		if ($FldVal2 <> "" && $IsValidValue && ew_IsValidOpr($FldOpr2, $Fld->FldDataType)) {
			if ($sWrk <> "") $sWrk .= "&v_" . $FldParm . "=" . urlencode($FldCond) . "&";
			$sWrk .= "&y_" . $FldParm . "=" . urlencode($FldVal2) .
				"&w_" . $FldParm . "=" . urlencode($FldOpr2);
		}
	}
	if ($sWrk <> "") {
		if ($Url <> "") $Url .= "&";
		$Url .= $sWrk;
	}
}
?>
<?php

// Render row values based on field settings
function RenderRow() {
	global $conn, $Security, $view_reg_master_netsales;

	// Call Row Rendering event
	$view_reg_master_netsales->Row_Rendering();

	// Common render codes for all row types
	if ($view_reg_master_netsales->RowType == EW_ROWTYPE_VIEW) { // View row
	} elseif ($view_reg_master_netsales->RowType == EW_ROWTYPE_ADD) { // Add row
	} elseif ($view_reg_master_netsales->RowType == EW_ROWTYPE_EDIT) { // Edit row
	} elseif ($view_reg_master_netsales->RowType == EW_ROWTYPE_SEARCH) { // Search row

		// ID
		$view_reg_master_netsales->ID->EditCustomAttributes = "";
		$view_reg_master_netsales->ID->EditValue = ew_HtmlEncode($view_reg_master_netsales->ID->AdvancedSearch->SearchValue);

		// LogDate
		$view_reg_master_netsales->LogDate->EditCustomAttributes = "";
		$view_reg_master_netsales->LogDate->EditValue = ew_HtmlEncode(ew_FormatDateTime($view_reg_master_netsales->LogDate->AdvancedSearch->SearchValue, 5));

		// RegID
		$view_reg_master_netsales->RegID->EditCustomAttributes = "";
		$sSqlWrk = "SELECT `RegisterID`, `RegisterID` FROM `tb_register`";
		$sSqlWrk .= " ORDER BY `RegisterID` Asc";
		$rswrk = $conn->Execute($sSqlWrk);
		$arwrk = ($rswrk) ? $rswrk->GetRows() : array();
		if ($rswrk) $rswrk->Close();
		array_unshift($arwrk, array("", "Please Select"));
		$view_reg_master_netsales->RegID->EditValue = $arwrk;

		// UserName
		$view_reg_master_netsales->UserName->EditCustomAttributes = "";
		$view_reg_master_netsales->UserName->EditValue = ew_HtmlEncode($view_reg_master_netsales->UserName->AdvancedSearch->SearchValue);

		// StoreNet
		$view_reg_master_netsales->StoreNet->EditCustomAttributes = "";
		$view_reg_master_netsales->StoreNet->EditValue = ew_HtmlEncode($view_reg_master_netsales->StoreNet->AdvancedSearch->SearchValue);

		// ShortOver
		$view_reg_master_netsales->ShortOver->EditCustomAttributes = "";
		$view_reg_master_netsales->ShortOver->EditValue = ew_HtmlEncode($view_reg_master_netsales->ShortOver->AdvancedSearch->SearchValue);

		// DiffIPP
		$view_reg_master_netsales->DiffIPP->EditCustomAttributes = "";
		$view_reg_master_netsales->DiffIPP->EditValue = ew_HtmlEncode($view_reg_master_netsales->DiffIPP->AdvancedSearch->SearchValue);

		// LogIPP
		$view_reg_master_netsales->LogIPP->EditCustomAttributes = "";
		$view_reg_master_netsales->LogIPP->EditValue = ew_HtmlEncode($view_reg_master_netsales->LogIPP->AdvancedSearch->SearchValue);

		// BankIPP
		$view_reg_master_netsales->BankIPP->EditCustomAttributes = "";
		$view_reg_master_netsales->BankIPP->EditValue = ew_HtmlEncode($view_reg_master_netsales->BankIPP->AdvancedSearch->SearchValue);

		// DiffXreading
		$view_reg_master_netsales->DiffXreading->EditCustomAttributes = "";
		$view_reg_master_netsales->DiffXreading->EditValue = ew_HtmlEncode($view_reg_master_netsales->DiffXreading->AdvancedSearch->SearchValue);

		// MOAmt
		$view_reg_master_netsales->MOAmt->EditCustomAttributes = "";
		$view_reg_master_netsales->MOAmt->EditValue = ew_HtmlEncode($view_reg_master_netsales->MOAmt->AdvancedSearch->SearchValue);

		// BankMO
		$view_reg_master_netsales->BankMO->EditCustomAttributes = "";
		$view_reg_master_netsales->BankMO->EditValue = ew_HtmlEncode($view_reg_master_netsales->BankMO->AdvancedSearch->SearchValue);

		// BankCC
		$view_reg_master_netsales->BankCC->EditCustomAttributes = "";
		$view_reg_master_netsales->BankCC->EditValue = ew_HtmlEncode($view_reg_master_netsales->BankCC->AdvancedSearch->SearchValue);

		// DiffCopay
		$view_reg_master_netsales->DiffCopay->EditCustomAttributes = "";
		$view_reg_master_netsales->DiffCopay->EditValue = ew_HtmlEncode($view_reg_master_netsales->DiffCopay->AdvancedSearch->SearchValue);

		// CheckAmt
		$view_reg_master_netsales->CheckAmt->EditCustomAttributes = "";
		$view_reg_master_netsales->CheckAmt->EditValue = ew_HtmlEncode($view_reg_master_netsales->CheckAmt->AdvancedSearch->SearchValue);

		// CreditAmt
		$view_reg_master_netsales->CreditAmt->EditCustomAttributes = "";
		$view_reg_master_netsales->CreditAmt->EditValue = ew_HtmlEncode($view_reg_master_netsales->CreditAmt->AdvancedSearch->SearchValue);

		// LunchAmt
		$view_reg_master_netsales->LunchAmt->EditCustomAttributes = "";
		$view_reg_master_netsales->LunchAmt->EditValue = ew_HtmlEncode($view_reg_master_netsales->LunchAmt->AdvancedSearch->SearchValue);

		// PayoutAmt
		$view_reg_master_netsales->PayoutAmt->EditCustomAttributes = "";
		$view_reg_master_netsales->PayoutAmt->EditValue = ew_HtmlEncode($view_reg_master_netsales->PayoutAmt->AdvancedSearch->SearchValue);

		// 340B
		$view_reg_master_netsales->z340B->EditCustomAttributes = "";
		$view_reg_master_netsales->z340B->EditValue = ew_HtmlEncode($view_reg_master_netsales->z340B->AdvancedSearch->SearchValue);

		// R2(CI)
		$view_reg_master_netsales->R228CI29->EditCustomAttributes = "";
		$view_reg_master_netsales->R228CI29->EditValue = ew_HtmlEncode($view_reg_master_netsales->R228CI29->AdvancedSearch->SearchValue);

		// Kinray
		$view_reg_master_netsales->Kinray->EditCustomAttributes = "";
		$view_reg_master_netsales->Kinray->EditValue = ew_HtmlEncode($view_reg_master_netsales->Kinray->AdvancedSearch->SearchValue);

		// CashAdj
		$view_reg_master_netsales->CashAdj->EditCustomAttributes = "";
		$view_reg_master_netsales->CashAdj->EditValue = ew_HtmlEncode($view_reg_master_netsales->CashAdj->AdvancedSearch->SearchValue);

		// OverAmt
		$view_reg_master_netsales->OverAmt->EditCustomAttributes = "";
		$view_reg_master_netsales->OverAmt->EditValue = ew_HtmlEncode($view_reg_master_netsales->OverAmt->AdvancedSearch->SearchValue);
	}

	// Call Row Rendered event
	$view_reg_master_netsales->Row_Rendered();
}
?>
<?php

// Load advanced search
function LoadAdvancedSearch() {
	global $view_reg_master_netsales;
	$view_reg_master_netsales->ID->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_ID");
	$view_reg_master_netsales->LogDate->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_LogDate");
	$view_reg_master_netsales->RegID->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_RegID");
	$view_reg_master_netsales->UserName->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_UserName");
	$view_reg_master_netsales->StoreNet->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_StoreNet");
	$view_reg_master_netsales->ShortOver->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_ShortOver");
	$view_reg_master_netsales->DiffIPP->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_DiffIPP");
	$view_reg_master_netsales->LogIPP->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_LogIPP");
	$view_reg_master_netsales->BankIPP->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_BankIPP");
	$view_reg_master_netsales->DiffXreading->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_DiffXreading");
	$view_reg_master_netsales->MOAmt->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_MOAmt");
	$view_reg_master_netsales->BankMO->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_BankMO");
	$view_reg_master_netsales->BankCC->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_BankCC");
	$view_reg_master_netsales->DiffCopay->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_DiffCopay");
	$view_reg_master_netsales->CheckAmt->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_CheckAmt");
	$view_reg_master_netsales->CreditAmt->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_CreditAmt");
	$view_reg_master_netsales->LunchAmt->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_LunchAmt");
	$view_reg_master_netsales->PayoutAmt->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_PayoutAmt");
	$view_reg_master_netsales->z340B->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_z340B");
	$view_reg_master_netsales->R228CI29->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_R228CI29");
	$view_reg_master_netsales->Kinray->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_Kinray");
	$view_reg_master_netsales->CashAdj->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_CashAdj");
	$view_reg_master_netsales->OverAmt->AdvancedSearch->SearchValue = $view_reg_master_netsales->getAdvancedSearch("x_OverAmt");
}
?>
<?php

// Page Load event
function Page_Load() {

	//echo "Page Load";
}

// Page Unload event
function Page_Unload() {

	//echo "Page Unload";
}
?>
